package org.vectrics.common.struts;

import javax.servlet.jsp.JspException;

import org.vectrics.struts.VectricsActionData;
import org.vectrics.struts.VectricsStrutsAction;

public class ToggleContentEditMode extends VectricsStrutsAction {

	@Override
	protected String doExecute(VectricsActionData actionData)
			throws JspException {

		Boolean editMode = (Boolean)actionData.getRequest().getSessionAttribute("editContentMode");	
		if ((editMode == null) || (editMode.booleanValue() == false)) {
			actionData.getRequest().setSessionAttribute("editContentMode", new Boolean(true));
		} else {
			actionData.getRequest().setSessionAttribute("editContentMode", new Boolean(false));
		}
		return "success";
	}

}
